package com.longge;

public class MinimumCost {

    public int minimumCost(int[] nums) {

        int ans = Integer.MAX_VALUE;

        for (int j = 1; j < nums.length; j++) {
            for (int k = j + 1; k < nums.length; k++) {
                ans = Math.min(nums[0] + nums[j] + nums[k], ans);
            }
        }

        return ans;
    }

}
